from django.contrib.auth.models import AbstractUser
from django.db import models


# Create your models here.
class UserProfile(AbstractUser):
    nickname = models.CharField(max_length=32,default="")
    phone = models.CharField(max_length=11,verbose_name="电话号码")
    avatar = models.ImageField(upload_to="avatar",null=True,verbose_name="用户头像")
    sign = models.CharField(max_length=50,default="001",verbose_name="个性签名")
    info = models.TextField(null=True,verbose_name="简介信息")
    updated_time = models.DateTimeField(auto_now=True,verbose_name="修改日期")

    class Meta:
        db_table = "user_profile"
        verbose_name = "用户"
        verbose_name_plural = "用户"

    def __str__(self):
        return self.username


